package com.uni.sofia.reader.utils
{
	import com.uni.sofia.reader.magazine.Magazine;
	import com.uni.sofia.reader.model.ApplicationManager;

	/**
	 * Class dedicated for parsing states of the reader application
	 */ 
	public class StateParser
	{
		/**
		 * Returns value object for a magazine state
		 * 
		 * @param magazine
		 * 		selected magazine
		 * @return
		 * 		the state json object
		 */ 
		public function magazineState(magazine:Magazine):Object
		{
		    var json:Object = {};
			json.state = ApplicationManager.MAGAZINE_STATE;
			json.magazine = magazine.name;
			json.issue = magazine.released.time;
			return json;
		}
	}
}